package com.ruoyi.bizsys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.bizsys.domain.CustBankCard;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 客户绑定银行卡Mapper接口
 *
 * @author african-loan
 * @date 2021-12-30
 */
public interface CustBankCardMapper extends BaseMapper<CustBankCard>{

    /**
     * 查询用户绑卡有效期
     * @return
     */
    public List<CustBankCard> selectBindCardPeriod();

    /**
     * 修改用户绑卡有效期状态
     * @param smsSendLogList
     * @return
     */
    int updateBatch(List<CustBankCard> smsSendLogList);

    CustBankCard getDetailByCustIdCardId(CustBankCard custBankCard);

    @Update("update cust_bank_card set state=#{code} where cust_no=#{custNo} ")
    void updateStates(@Param("custNo") String custNo, @Param("code") String code);

    String selectCustBankCardMaxCnt(@Param("custNo") String custNo);

    int selectCustBankCardCnt(@Param("custNo") String custNo);
}
